<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./toBase64.js"></script>
</head>

<body>

</body>


<script>
    let imgUrl = "https://b-ssl.duitang.com/uploads/item/201809/16/20180916015041_dvmxh.thumb.700_0.jpg"

    getCanvasBase64(imgUrl).then((base64) => {
        console.log('base64', base64);
    })
</script>

</html>